/*
 * @Author: chenzanjing
 * @Date: 2023-10-18 18:08:39
 * @LastEditors: chenzanjing
 * @LastEditTime: 2023-10-24 14:36:20
 * @FilePath: \zhiji-manage-front\src\api\modules\menu.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */

import http from "@/api";
export default class Menu {
  getMenuList(params?: any) {
    return http.get(`/menu/list`, { params });
  }
  // 添加菜单
  addMenu = (params: Menu.MenuOptions) => {
    return http.post(`menu`, params);
  };
  // 修改菜单
  editMenu = (params: { id: string }) => {
    return http.put(`/menu`, params);
  };
  deleteMenu = (params: { id: string }) => {
    return http.delete(`/menu/${params.id}`);
  };
  getMenuTreeSelect() {
    return http.get(`/menu/treeselect`);
  }
  roleMenuTreeselect(roleId: string) {
    return http.get(`/menu/roleMenuTreeselect/${roleId}`);
  }
}
